package cn.yto.print.controller.rest;

import cn.yto.print.model.request.CameraLoginRequest;
import cn.yto.print.model.request.CameraOsdRequest;
import cn.yto.print.model.response.CameraLoginResponse;
import cn.yto.print.model.response.CameraResponse;
import cn.yto.print.service.CameraDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("camera")
@CrossOrigin(origins = "*")
public class CameraController {

    @Autowired
    private CameraDeviceService cameraDeviceService;

    @PostMapping("/hk/login")
    public CameraResponse<CameraLoginResponse> login(@RequestBody CameraLoginRequest request) {
        return cameraDeviceService.login(request);
    }

    @PostMapping("/hk/osd")
    public CameraResponse osd(@RequestBody CameraOsdRequest request) {
        return cameraDeviceService.cameraOsd(request);
    }

    @PostMapping("/hk/checkStatus")
    public CameraResponse checkStatus(@RequestBody CameraOsdRequest request) {
        return cameraDeviceService.checkCameraStatus(request);
    }

}
